package com.tcxhb.job.core.service.job;

import com.tcxhb.job.core.entity.ServerNode;

/**
 * @Description:
 * @Auther: tcxhb
 * @Date: 2023/11/20
 */
public interface ServerMonitor {

    /**
     * 获取当前run的节点
     *
     * @return
     */
    public String runningServer();

    /**
     * @param oldNode 用来做乐观锁
     * @return
     */
    public Boolean lock(String oldNode);

    /**
     * @param oldNode
     * @return
     */
    public Boolean unlock(String oldNode);

    /**
     * 节点下线
     * @return
     */
    public Boolean offline();

    /**
     * 获取当前服务器节点信息
     *
     * @return
     */
    public ServerNode currentNode();
}
